#ifndef DIALOGITEM_H
#define DIALOGITEM_H

#include "imageitem.h"
#include "commons.h"

class DialogItem : public ImageItem
{
    Q_OBJECT
public:
    explicit DialogItem(const QString &imgName,
                        const QPoint &leftTop,
                        const QPoint &rightBottom,
                        QGraphicsScene *scene = 0,
                        QGraphicsItem *parent = 0);

    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

    virtual void popup();

signals:
    void dialogClosed();

public slots:
    virtual void buttonClicked(ButtonItem* who);

protected:
    ButtonItem *closeButton;
    bool onDrag;
    DistanceF toCenter;

};

#endif // DIALOGITEM_H
